﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;
using System.Xml.Linq;

namespace FlickrPortfolio.Helpers {
    public static class AppHelper {
        public static string GetAPIKey() {
            var key = GetConfig().SelectSingleNode("/FlickrPortfolio/Config/Key").InnerText;
            return key;
        }

        public static string GetAPISecret() {
            var secret = GetConfig().SelectSingleNode("/FlickrPortfolio/Config/Secret").InnerText;
            return secret;
        }

        public static string GetUserID() {
            var user = GetConfig().SelectSingleNode("/FlickrPortfolio/Config/User").InnerText;
            return user;
        }

        public static string GetToken() {
            var token = GetConfig().SelectSingleNode("/FlickrPortfolio/Config/Token").InnerText;
            return token;
        }

        private static XmlDocument GetConfig() {
            var config = new XmlDocument();
            config.Load("D:\\Documents\\Visual Studio 2008\\Projects\\FlickrPortfolio\\FlickrPortfolio\\App_Data\\Config.xml");
            return config;
        }
    }
}
